﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LS.Entitys;
namespace LS.Cores
{
    /// <summary>
    /// 提供功能项管理服务
    /// </summary>

    public class SysFunctionService : BaseService<SysFunctionEntity>, ISysFunction
    {
        #region 实现接口方法
        public bool ExistsFunCode(string id, string funCode)
        {
            StringBuilder strsql = new StringBuilder();
            strsql.Append("select count(1)  From  sys_function where 1=1 ");
            if (!string.IsNullOrEmpty(id) && id != "0" )
            {
                strsql.Append(" and  id!='" + id + "'");
            }
            if (!string.IsNullOrEmpty(funCode))
            {
                strsql.Append(" and  funcode='" + funCode + "'");
            }
            return SqlHelper.ExecuteScalar<int>(strsql.ToString()) > 0 ? true : false;
        }

        #endregion 实现接口方法


    }
}
